#! /bin/bash
while read line
do
	user=`echo $line|awk '{print $1}'`
	pass=`echo $line|awk '{print $2}'`
	id $user &>/dev/null
	if [ $? -eq 0 ];then
		echo "$user用户已存在"
	else
		useradd $user
		echo "$pass"|passwd --stdin $user &>/dev/null
        	if [ $? -eq 0 ];then
                	echo "$user is create"
		fi
	fi
done < user1.txt
